﻿/**************************************************************
 *
 * 唯一标识：9e5dd409-254e-409b-9ff7-d552c7381842
 * 命名空间：Sgr.UPMS.Application.Validations.Users
 * 创建时间：2023/8/27 13:04:43
 * 机器名称：DESKTOP-S0D075D
 * 创建者：antho
 * 电子邮箱：fengqinhua2016@163.com
 * 描述：
 *
 **************************************************************/

using FluentValidation;
using Sgr.UPMS.Application.Commands.Users;

namespace Sgr.UPMS.Application.Validations.Users
{
    /// <summary>
    /// 调整用户状态命令验证器
    /// </summary>
    public class ModifyUserStatusCommandValidator : AbstractValidator<ModifyUserStatusCommand>
    {
        public ModifyUserStatusCommandValidator()
        {
            RuleFor(command => command.UserId)
                .GreaterThan(0)
                .WithMessage("用户标识必须大于0");

            RuleFor(command => command.State)
                .IsInEnum()
                .WithMessage("用户状态只能为Normal或Deactivate");
        }
    }
}